home *** CD-ROM | disk | FTP | other *** search
- /* Scandir.frx
- * Copyright © 1995-1998 Nils Bandener
- * $VER: scandir_frx 8.1 (23.6.98)
- */
-
- Options Results
-
- scriptname = "ScanDir / Mailing List Archive"
-
- fiasco_port = address()
-
- Signal on Syntax
- Signal on Halt
- Signal on Break_C
- Signal on Failure
-
- LockGUI
-
- /*
- * Get the directory to search in
- */
-
- RequestFile Drawersonly
-
- if rc = 0 then do
-
- /*
- * User did not cancel the requester
- */
-
- directory = Result
-
- /*
- * Create a list
- */
-
- say "Scanning directory..."
-
- Address Command 'list >t:fpdb_files "' || directory || '" lformat %s%s files pat ~(#?.info) '
-
- if rc = 0 then
- do
-
- say "Adding mails... (Press Ctrl-C for break)"
-
- if Open("g", "t:fpdb_files", "read") then do
-
- do while ~eof("g")
- file = ReadLn("g")
-
- if file ~= "" then
- do
- call importmail.frx(file)
- end
- end
-
- call Close("g")
- end
- end
- end
-
- bail_out:
-
- Address Value fiasco_port
-
- UnlockGUI
- ResetStatus
-
- exit
-
- syntax:
- failure:
-
- if show("Ports", fiasco_port) then
- do
- Address Value fiasco_port
-
- RequestChoice '"Error ' || rc || ' in line ' || sigl || ':*n' || errortext(rc) || '" "Cancel" Title "' || scriptname || '"'
- end
- else
- do
- say "Error" rc "in line" sigl ":" errortext(rc)
- say "Enter to continue"
- pull dummy
- end
-
- call bail_out
-
- halt:
- break_c:
-
- if show("Ports", fiasco_port) then
- do
- Address Value fiasco_port
-
- RequestChoice '"Script Abort Requested" "Abort Script" Title "' || scriptname || '"'
-
- if result = 0 then return
- end
- else
- do
- say "*** Break"
- say "Enter to continue"
- pull dummy
- end
-
- call bail_out
-
-